<html>
  <head>
    <link href="../enzo.css" rel="stylesheet" type="text/css">
    <title>Enzo user's guide: running a cosmology simulation</title>
  </head>
<body>
<h1>Running a Cosmology Simulation</h1>
Once the code is compiled and a parameter file is prepared, starting the
simulation is easy:
<p><tt>mpirun -np 1 enzo [-d] parameter_file</tt><tt></tt>
<p>The syntax of the mpirun varies between mpi implementations.&nbsp; The
example given here comes from the Origin2000 and implies a single processors
(the argument after the -np flag indicates the number of processors.&nbsp;

<p>Once again, the -d flag triggers a debug option that produces a substantial
amount of output.&nbsp; See the <a href="../cookbook/index.html">Enzo Cookbook</a>
for more detailed information on running simulations.</p>

<h3>Restarting</h3>
During a run, there are a number of forms of output.&nbsp; The largest
will probably be the output of the grid hierarchy as specified by parameters
such as dtDataDump and the CosmologyOutputRedshift.&nbsp; Such outputs
contain a number of different files (sometimes many files if there are
a large number of grids) and are explained <a href="output.html">elsewhere</a>.&nbsp;
It is useful to have a fairly large number of such outputs if the run is
a long one, both to provide more information to analyze, but also in case
of an unintended interruption (crash).&nbsp; Fortunately, any full output
can be used to restart the simulation:
<p><tt>mpirun -np 1 enzo [-d] -r output_name</tt>

<h3>Monitoring information</h3>
As the simulation runs, at every top grid timestep, it outputs a line of
information to the ascii file <tt>OutputLevelInformation</tt> (which is
overwritten on restart).&nbsp; The amount of information on this line can
be quite extensive, but here the format is briefly summarized.&nbsp; The
first number is the problem time, while the next 6 relate to general information
about the entire run.&nbsp; Within these six numbers, the first is the
maximum level currently in use, the second is the number of grids, the
third is a number proportional to the memory used, the fourth is the mean
axis ratio of all grids, and the last two are reserved for future use.&nbsp;
Then, there will be three spaces, and another group of numbers, all providing
information about the first (top grid) level.&nbsp; This pattern of three
spaces and six numbers is repeated for every level.&nbsp; The information
for each level is: 1) number of grids on the level, 2) memory usage (roughly),&nbsp;
3) the volume fraction of the entire region covered by grids on this level,
4) the mean axis ratio of grids on this level (please don't ask why this
information is here), 5) the fraction of cells on this level which need
refinement (I think), 6) the number of active cells on this level.

<h3>Debugging information</h3>
It is often useful to run with the debug flag turned on, particularly if
the code is crashing for unknown reasons (which never happens of course).&nbsp;
However, the amount of output is quite large so it is useful to redirect
this to a log file, such as:
<p>mpirun -np 1 enzo -d -r output_name > log_file
<p>Some modules (the cooling unit is particularly bad for this), produce
their own debugging logs in the form of fort.?? files.&nbsp; These can
be ignored unless problems occur.&nbsp; We hould probably stress again
that this code is not guaranteed to bug-free and is offered without any
assurances or warranties, implied or otherwise.
<p>
<p>&nbsp;</p>
<p><a href="../index.html">Go to the Enzo home page</a></p>

<hr WIDTH="100%">
<center>&copy; 2004 &nbsp; <a href="http://cosmos.ucsd.edu">Laboratory for Computational Astrophysics</a><br></center>
<center>last modified February 2004<br>
by <a href="mailto:bwoshea (AT) lanl.gov">B.W. O'Shea</a></center>

<br>&nbsp;
<br>&nbsp;
</body>
</html>
